<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>付款成功页面</title>


    <link rel="stylesheet" type="text/css" href="/AmazeUI-2.4.2/assets/css/amazeui.css"/>
    <link href="/AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css">
    <link href="/basic/css/demo.css" rel="stylesheet" type="text/css"/>

    <link href="/css/sustyle.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="/basic/js/jquery-1.7.min.js"></script>

    <script type="application/javascript">
        $(document).ready(function(){
            setTimeout(function(){
                getResult();
                },4000);

            $.ajax({
                //url:"http://localhost:8002/index/status.action",
                //url:"http://localhost:9527/index/index/status.action",
                url:"/index/index/status.action",
                //url:"http://localhost:8001/login/status.action",
                type:"post",
                contentType:"application/json",
                dataType:"json",
                success:function (result) {
                    if(result.state) {
                        //已经登录
                        if(result.data.email!=null&&result.data.email!=''){
                            $("#showuser").text('欢迎你 '+result.data.email);
                            $("#showuser").removeAttr('href');
                            $("#middle-uname").text(result.data.email);
                            $("#sidebar-username").text('用户名 '+result.data.email);
                        }else if(result.data.phone!=null&&result.data.phone!=''){
                            $("#showuser").text('欢迎你 '+result.data.phone);
                            $("#showuser").removeAttr('href');
                            $("#middle-uname").text(result.data.phone);
                            $("#sidebar-username").text('用户名 '+result.data.phone);
                        }else {
                            $("#showuser").text('欢迎你 '+result.data.username);
                            $("#showuser").removeAttr('href');
                            $("#middle-uname").text(result.data.username);
                            $("#sidebar-username").text('用户名 '+result.data.username);
                        }
                        //等级
                        $("#sidebar-level").text(result.data.flag+" 级别普通会员");

                        //头像
                        $("#sidebar-usr-img").attr("src",result.data.pic);
                        //alert(result.data.pic);

                        $("#showexit").text("退出登录");
                        // $("#showexit").removeAttr("href");
                        //$("#showexit").attr("onclick","logout()");
                        //$("#showexit").attr("href","/index/index/logout.action");
                        $("#showexit").attr("href","/user/login/logout.action");

                        $("#middle-login").text("退出登录");
                        $("#middle-login").attr("href","/user/login/logout.action");
                        $("#middle-reg").hide();
                    }
                }
            });
            $.ajax({
                //获取购物车
                url:"/cart/cart/show",
                type:"get",
                contentType:"application/json",
                dataType:"json",
                success:function (result) {
                    if(result.state) {
                        var list=result.data;
                        $("#sidebar-cart-num").text(list.length);
                        $("#J_MiniCartNum").text(list.length);
                    }else{
                        $("#sidebar-cart-num").text("空");
                    }
                }
            });
        });
        function search() {
            var keyword = $("#searchInput").val();
            //location.href = "http://localhost:8003/search/product/" + keyword;
            //location.href = "http://localhost:9527/search/search/product/" + keyword;
            location.href = "/search/search/product/" + keyword;
            return false;
        }

        function getResult() {
            var temp=$('#out_trade_no').val();
            $.ajax({
                //获取购物车
                url:"/pay/pay/getResult?orderno="+temp,
                type:"post",
                contentType:"application/json",
                dataType:"json",
                success:function (result) {
                    if(result.state) {
                        $("#result_msg").text("您已成功付款");
                    }else{
                        $("#result_msg").text("付款失败！！！");
                    }
                }
            });


        }
    </script>
</head>

<body>

<input id="out_trade_no" type="hidden" th:value="${out_trade_no}"/>
<!--顶部导航条 -->
<div class="am-container header">
    <ul class="message-l">
        <div class="topMessage">
            <div class="menu-hd">
                <a id="showuser" href="/user/page/login" target="_top" class="h">亲，请登录</a>
                <a id="showexit" href="/user/page/register" target="_top">免费注册</a>
            </div>
        </div>
    </ul>
    <ul class="message-r">
        <div class="topMessage home">
            <div class="menu-hd"><a href="/" target="_top" class="h">商城首页</a></div>
        </div>
        <div class="topMessage my-shangcheng">
            <div class="menu-hd MyShangcheng"><a href="#" target="_top"><i class="am-icon-user am-icon-fw"></i>个人中心</a></div>
        </div>
        <div class="topMessage mini-cart">
            <div class="menu-hd"><a id="mc-menu-hd" href="/cart/page/cart" target="_top"><i class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong id="J_MiniCartNum" class="h">0</strong></a></div>
        </div>
        <div class="topMessage favorite">
            <div class="menu-hd"><a href="#" target="_top"><i class="am-icon-heart am-icon-fw"></i><span>收藏夹</span></a></div>
        </div>
    </ul>
</div>

<!--悬浮搜索框-->

<div class="nav white">
    <div class="logo"><img src="/images/logo.png" /></div>
    <div class="logoBig">
        <li><img src="/images/logobig.png" /></li>
    </div>

    <div class="search-bar pr">
        <a name="index_none_header_sysc" href="#"></a>
        <form>
            <input id="searchInput" name="index_none_header_sysc" type="text" placeholder="搜索" autocomplete="off">
            <input id="ai-topsearch" class="submit am-btn" value="搜索" index="1" type="button" onclick="search()">
        </form>
    </div>
</div>

<div class="clear"></div>


<div class="take-delivery">
    <div class="status">
        <h2 id="result_msg">正在等待支付宝返回支付结果</h2>
        <div class="successInfo">
            <ul>
                <li>付款金额<em><span th:text="${money}"></span></em></li>
<!--                <div class="user-info">-->
<!--                    <p>收货人：艾迪</p>-->
<!--                    <p>联系电话：15871145629</p>-->
<!--                    <p>收货地址：湖北省 武汉市 武昌区 东湖路75号众环大厦</p>-->
<!--                </div>-->
<!--                请认真核对您的收货信息，如有错误请联系客服-->

            </ul>
            <div class="option">
                <span class="info">您可以</span>
                <a href="/" class="J_MakePoint">查看<span>已买到的宝贝</span></a>
                <a href="/" class="J_MakePoint">查看<span>交易详情</span></a>
            </div>
        </div>
    </div>
</div>


<div class="footer">
    <div class="footer-hd">
        <p>
            <a href="#">恒望科技</a>
            <b>|</b>
            <a href="#">商城首页</a>
            <b>|</b>
            <a href="#">支付宝</a>
            <b>|</b>
            <a href="#">物流</a>
        </p>
    </div>
    <div class="footer-bd">
        <p>
            <a href="#">关于恒望</a>
            <a href="#">合作伙伴</a>
            <a href="#">联系我们</a>
            <a href="#">网站地图</a>
            <em>© 2015-2025 Hengwang.com 版权所有</em>
        </p>
    </div>
</div>


</body>
</html>
